package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexao {
	
	private static Connection connection = null;
	
	public static Connection pegarConexao() throws ClassNotFoundException, SQLException{
		if(connection == null){
			Class.forName("org.postgresql.Driver");
			
			String usuario = "postgres";
			String senha = "462570";
			String url = "jdbc:postgresql://localhost:5432/autohire";
			
			connection = DriverManager.getConnection(url, usuario, senha);
			
						
		}
		
		return connection;
	}
}
